#include <REGX52.H>
#include "Delay.h"
#include "LCD1602.h"
#include "Nixie.h"
#include "Matrix.h"

//测试数码管是否能正常显示
void testNixie()
{
	lightNixieTube(1, 1);
	lightNixieTube(2, 2);
	lightNixieTube(3, 3);
	lightNixieTube(4, 4);
	lightNixieTube(5, 5);
	lightNixieTube(6, 6);
}
//测试LCD
void testLCD()
{
	LCD_Init();
//	LCD_ShowChar(1, 1, 'A');
//	LCD_ShowString(1, 3, "HelloWorld");
//	LCD_ShowNum(1, 14, 12, 3);
//	LCD_ShowSignedNum(2, 1, -66, 2);
//	LCD_ShowHexNum(2, 5, 0x6B, 2);
	LCD_ShowBinNum(2, 8, 0x55, 8);
}

void testMatrix()
{
	unsigned char keyNumber = 0;
	//初始化
	LCD_Init();
	while(1)
	{
		keyNumber = matrixKey();
		if(keyNumber != 0)
			LCD_ShowNum(1, 1, keyNumber, 3);
	}
}
	
int main()
{
	
	//testNixie();
	//testLCD();
	testMatrix();
	return 0;
}